<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.6.0/jquery.js"></script>

    <style>
        *,body{
            padding: 0;
            margin: 0;
        }
        div{
            float: left;
            width: 50%;
            height: 100vh;
            text-align: center;
            font-size: 48px;
            line-height: 100vh;
            font-weight: 700;
            letter-spacing: 3px;
        }
    </style>
</head>
<body>
    <div class="box"></div>
    <div class="box2"></div>
    <script>
        
        function getRGB(){
            var str = `rgb(${Math.floor(Math.random()*256)},${Math.floor(Math.random()*256)},${Math.floor(Math.random()*256)})`
            return str
        }
        function getRGBA(){
            var str = `rgba(${Math.floor(Math.random()*256)},${Math.floor(Math.random()*256)},${Math.floor(Math.random()*256)},.${Math.floor(Math.random()*10)})`
            return str
        }
        str_1 = getRGB()
        str_2 = getRGBA()

        $('.box').html(str_1).css('background',str_1)
        $('.box2').html(str_2).css('background',str_2)
        
    </script>
</body>
</html>